import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { Language } from "../../../../../extend/language/Language";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GImageBitmap } from "../../../../../com/mui/controls/GImageBitmap";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { EJewel } from "../../../../../Message/Public/EJewel";
type int = number;
//class SecondCrareerAttribute
    
    export  class SecondCrareerAttribute /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public updateView(arg1: Array<any>): void
        {
            var loc2=0;
            var loc3=0;
            var loc4=null;
            var loc5=0;
            var loc1=0;
            while (loc1 < this.AttrLineNum) 
            {
                loc2 = 0;
                while (loc2 < this.AttrRowNum) 
                {
                    loc3 = loc1 * this.AttrRowNum + loc2;
                    loc4 = this._txtAttrs[loc3] as GTextFiled;
                    loc5 = int(arg1[loc3]);
                    if (loc4 != null) 
                    {
                        loc4.htmlText = Language.getString(this.NameStartIndex + loc3) + "<font color=\'#FEFDAD\'>" + loc5.toString() + "</font>";
                    }
                    ++loc2;
                }
                ++loc1;
            }
            this._txtFightPower.text = String(arg1[(arg1.length - 1)]);
            return;
        }

        /* internal  */initView(): void
        {
            var loc1=null;
            var loc2=null;
            var loc5=0;
            var loc6=0;
            ObjCreate.createBg(0, 0, 233, 310, this);
            this._txtAttrs = [];
            var loc3=0;
            while (loc3 < this.AttrLineNum) 
            {
                loc5 = 0;
                while (loc5 < this.AttrRowNum) 
                {
                    if ((loc6 = loc3 * this.AttrRowNum + loc5) >= this.AttrTotalNum) 
                    {
                        break;
                    }
                    loc2 = ObjCreate.createGTextField("", 0, 0, 200, 20, this);
                    loc1 = loc2.defaultTextFormat;
                    loc1.color = 16776960;
                    loc2.x = loc3 * 120 + 5;
                    loc2.y = loc5 * 20 + 6;
                    if (loc5 >= 4) 
                    {
                        loc2.y = loc2.y + 9;
                        loc1.color = 65280;
                    }
                    loc2.defaultTextFormat = loc1;
                    this.addChild(loc2);
                    this._txtAttrs.push(loc2);
                    ++loc5;
                }
                ++loc3;
            }
            ObjCreate.createBg(4, 88, 302, 1, this, ImagesConst.SplitLine);
            ObjCreate.createBg(4, 240, 302, 1, this, ImagesConst.SplitLine);
            addChild(new GImageBitmap(ImagesConst.FightingStrgLabel, 77, 250));
            ObjCreate.createBg(50, 280, 122, 22, this, ImagesConst.SelectedBg);
            var loc4;
            (loc4 = ObjCreate.createGLoadedButton("FightingIcon", 61, 282, 19, 18, this)).toolTipData = this.getTipData();
            this._txtFightPower = ObjCreate.createGTextField("", 50, 283, 122, 20, this);
            loc1 = this._txtFightPower.defaultTextFormat;
            loc1.color = 15788607;
            loc1.size = 14;
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._txtFightPower.defaultTextFormat = loc1;
            return;
        }

        /* internal  */getTipData(): string
        {
            var loc1="";
            loc1 = loc1 + HTMLUtil.addColor(Language.getString(30028) + "\n", "#FF7902");
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(30029, "<font color=\'#f0ea3f\'>", "</font>", "<font color=\'#00ff00\'>") + "</font>。\n", "#ffffff");
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(30030, "<font color=\'#f0ea3f\'>", "</font>", "<font color=\'#00ff00\'>") + "</font>。\n", "#ffffff");
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(30031, "<font color=\'#f0ea3f\'>", "</font>", "<font color=\'#00ff00\'>") + "</font>。\n", "#ffffff");
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(30032, "<font color=\'#f0ea3f\'>", "</font>", "<font color=\'#00ff00\'>") + "</font>。\n", "#ffffff");
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(30033, "<font color=\'#FF00FF\'>") + "</font>。\n", "#ffffff");
            return loc1;
        }

        /* internal */ /* const */NameStartIndex: int=80208;

        /* internal */ /* const */AttrTotalNum: int=21;

        /* internal */ /* const */AttrLineNum: int=2;

        /* internal */ /* const */AttrRowNum: int=11;

        /* internal */ /* const */YelloColorNum: int=8;

        public static /* const */AdditionsP: Array<any>=[EJewel._EJewelLife, EJewel._EJewelMana, EJewel._EJewelPhysicalAttack, EJewel._EJewelMagicAttack, EJewel._EJewelPower, EJewel._EJewelAgile, EJewel._EJewelHabitus, EJewel._EJewelBrains, EJewel._EJewelSpiritual, EJewel._EJewelHit, EJewel._EJewelJouk, EJewel._EJewelPhysicalDefense, EJewel._EJewelMagicDefense, EJewel._EJewelPhysicalCrit, EJewel._EJewelMagicCrit, EJewel._EJewelToughness, EJewel._EJewelSpeededUp, EJewel._EJewelBlock, EJewel._EJewelRelief, EJewel._EJewelPhysicalCrit, EJewel._EJewelPass];

        public static /* const */AdditionsM: Array<any>=[EJewel._EJewelLife, EJewel._EJewelMana, EJewel._EJewelPhysicalAttack, EJewel._EJewelMagicAttack, EJewel._EJewelPower, EJewel._EJewelAgile, EJewel._EJewelHabitus, EJewel._EJewelBrains, EJewel._EJewelSpiritual, EJewel._EJewelHit, EJewel._EJewelJouk, EJewel._EJewelPhysicalDefense, EJewel._EJewelMagicDefense, EJewel._EJewelPhysicalCrit, EJewel._EJewelMagicCrit, EJewel._EJewelToughness, EJewel._EJewelSpeededUp, EJewel._EJewelBlock, EJewel._EJewelRelief, EJewel._EJewelMagicCrit, EJewel._EJewelPass];

        /* internal */ /* var */_txtAttrs: Array<any>;

        /* internal */ /* var */_txtFightPower: GTextFiled;
    }
